package cn.flyingocean;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

public class PullNameFromFile {
	public static List<String> pull(String filePath){
		 try {
			 List<String> resultList = new ArrayList<String>();
			 FileInputStream fis = new FileInputStream(filePath);
	          InputStreamReader isr = new InputStreamReader(fis,"UTF-8");
	          BufferedReader reader = new BufferedReader(isr);
	          String line = reader.readLine();
	          while(true) {
	        	  if(line == null) {
	        		  break;
	        	  }
	        	  resultList.add(new String(line));
	        	  line = reader.readLine();
	          }
	          reader.close();
        	  isr.close();
        	  fis.close();
        	  
        	  return resultList;
		 }catch(Exception e) {
			 e.printStackTrace();
		 }
		 return null;
	}
}
